package com.jiagoushi.cloud.study.user.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jiagoushi.cloud.study.user.entity.User;

/**
 * 推荐使用
 */
@FeignClient(name = "microservice-provider-user")
public interface UserFeignClient {

  // 会根据name = "microservice-provider-user" 和 value = "/{id}", method = RequestMethod.GET
  // 这个几个属性来指定调用user服务哪个接口
  @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  public User findById2(@PathVariable("id") Long id); // 方法名称随便写，但是最好与提供方一样，参数和提供方列表参数的顺序一致
}
